Skip to content

Instantly share code, notes, and snippets.

Avatar
😻
I may be slow to respond.

huihut huihut

😻
I may be slow to respond.
View GitHub Profile
View DirectX11Window.cpp
// 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")
View dx_util.cpp
#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 Aug 21, 2019
Qt Dialog 点击窗口外隐藏
View HideQDialog.cpp
// 重写事件
bool event(QEvent *event)
{
if (event->type() == QEvent::ActivationChange)
{
if (QApplication::activeWindow() != this)
{
this->hide();
}
}
@huihut
huihut / program_running_time.cpp
Created Aug 13, 2019
Statistical program running time
View program_running_time.cpp
#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 Mar 23, 2019
Unity TakeScreenshot
View Screenshot.cs
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 Mar 23, 2019
Unity TakeScreenshot
View Screenshot.cs
// <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 Mar 23, 2019
Unity TakeScreenshot
View TakeScreenshot.cs
// <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 / SQLiteHelper.cs
Created Mar 18, 2019
C# SQLiteHelper 数据库操作类
View SQLiteHelper.cs
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SQLite;
/// <summary>
/// 数据库操作类
/// </summary>
public sealed class SQLiteHelper
{
@huihut
huihut / UnityPlatform.md
Last active Jan 13, 2019
Unity Platform dependent compilation
View UnityPlatform.md
@huihut
huihut / deb_mirror_sources.list
Created Dec 28, 2018
Ubuntu deb mirror sources
View deb_mirror_sources.list
## 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
You can’t perform that action at this time.