Skip to content

Instantly share code, notes, and snippets.

View huihut's full-sized avatar
🌴
On vacation

huihut huihut

🌴
On vacation
View GitHub Profile
@huihut
huihut / tasks.json
Created June 12, 2018 09:12
Configuring tasks.json for C/C++ debugging
// Available variables which can be used inside of strings.
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process
{
// include the basic windows header files and the Direct3D header files
#include <windows.h>
#include <windowsx.h>
#include <d3d11.h>
#include <d3dx11.h>
#include <d3dx10.h>
// include the Direct3D Library file
#pragma comment (lib, "d3d11.lib")
#pragma comment (lib, "d3dx11.lib")
#include "precomp.h"
#include "util.h"
using namespace Microsoft::WRL;
using namespace WEX::TestExecution;
PCWSTR StringFromFeatureLevel (D3D_FEATURE_LEVEL FeatureLevel)
{
switch (FeatureLevel) {
case D3D_FEATURE_LEVEL_12_1: return L"12.1";
@huihut
huihut / HideQDialog.cpp
Created August 21, 2019 03:15
Qt Dialog 点击窗口外隐藏
// 重写事件
bool event(QEvent *event)
{
if (event->type() == QEvent::ActivationChange)
{
if (QApplication::activeWindow() != this)
{
this->hide();
}
}
@huihut
huihut / program_running_time.cpp
Created August 13, 2019 09:26
Statistical program running time
#include<iostream>
#include<time.h>
using namespace std;
int main()
{
clock_t startTime,endTime;
startTime = clock();
for (int i = 0; i < 1000000; i++)
@huihut
huihut / Screenshot.cs
Created March 23, 2019 14:21
Unity TakeScreenshot
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Screenshot : MonoBehaviour
{
private int index = 0;
// Start is called before the first frame update
void Start()
@huihut
huihut / Screenshot.cs
Created March 23, 2019 14:19
Unity TakeScreenshot
// <http://wiki.unity3d.com/index.php?title=TakeScreenshot>
// ****** Notice : It doesn't works in Wep Player environment. ******
// ****** It works in PC environment. ******
// Default method have some problem, when you take a Screen shot for your game.
// So add this script.
// CF Page : http://technology.blurst.com/unity-jpg-encoding-javascript/
// made by Jerry ( sdragoon@nate.com )
using UnityEngine;
@huihut
huihut / TakeScreenshot.cs
Created March 23, 2019 14:18
Unity TakeScreenshot
// <http://wiki.unity3d.com/index.php?title=TakeScreenshot>
// TODO:
// By default, screenshot files are placed next to the executable bundle -- we don't want this in a
// shipping game, as it will fail if the user doesn't have write access to the Applications folder.
// Instead we should place the screenshots on the user's desktop. However, the ~/ notation doesn't
// work, and Unity doesn't have a mechanism to return special paths. Therefore, the correct way to
// solve this is probably with a plug-in to return OS specific special paths.
// Mono/.NET has functions to get special paths... see discussion page. --Aarku
@huihut
huihut / UnityPlatform.md
Last active January 13, 2019 06:06
Unity Platform dependent compilation
@huihut
huihut / deb_mirror_sources.list
Created December 28, 2018 03:52
Ubuntu deb mirror sources
## update sources
#sudo apt-get update
#sudo apt-get upgrade
## a good mirror based on your location
deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse