Skip to content

Instantly share code, notes, and snippets.

1c1
< X11+
---
> X11-
3,5c3,5
< autocmd+
< balloon_eval+
< browse+
---
> autocmd-
#include <iostream>
#include <fstream>
/*!
@param[in] path path of a file
@return byte size of a file (return -1 when file cannnot open)
*/
int filesize(char const * path)
{
std::ifstream fin(path, std::ios::in | std::ios::ate);
#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
using namespace std;
class angle;
class radian;
// angle(度数法)とradian(弧度法)の実装がほぼ同じなため
set path&
set path+=C:/Program\ Files\ (x86)/Microsoft\ Visual\ Studio\ 12.0/VC/include
set path+=C:/Program\ Files\ (x86)/Windows\ Kits/8.1/Include/shared
set path+=C:/Program\ Files\ (x86)/Windows\ Kits/8.1/Include/um
set path+=C:/Program\ Files\ (x86)/Windows\ Kits/8.1/Include/winrt
#include <iostream>
#include <random>
#include <chrono>
#include <limits>
#include <vector>
#include <functional>
#include <cmath>
using namespace std;
// IDXGIFactory7は生成済み
ComPtr<IDXGIFactory7> p_factory;
// 実際にはグローバル変数ではなく,何らかのメンバ変数など
D3D_FEATURE_LEVEL minimum_feature_level = D3D_FEATURE_LEVEL_12_0;
ComPtr<ID3D12Device6> p_device;
ComPtr<IDXGIAdapter4> p_adapter;
bool selectAdapter()
{
cbuffer model
{
float4x4 world;
};
float4 VS(float4 position : POSITION) : SV_POSITION
{
return mul(position, world);
// return mul(world, position);
}
cbuffer model
{
float4x3 world;
};
float4 VS(float4 position : POSITION) : SV_POSITION
{
return float4(mul(position, world), 1.0);
}
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.0.10011.16384
//
//
// Buffer Definitions:
//
// cbuffer model
// {
//
// float4x3 world; // Offset: 0 Size: 48
@ryutorion
ryutorion / main.cpp
Created May 25, 2020 14:18
Windowsでnew/deleteの置き換え
#include <Windows.h>
#include <cstdlib>
#include <vector>
void * operator new(std::size_t size)
{
OutputDebugStringA("Original New\n");
return malloc(size);
}