Skip to content

Instantly share code, notes, and snippets.

@zwcloud
zwcloud / MonoScriptTry.cpp
Created February 28, 2015 09:18
Trying mono in C++
#include <mono/jit/jit.h>
#include <mono/metadata/assembly.h>
#pragma comment(lib, "mono-2.0.lib")
int main(int argc, char* argv[])
{
mono_set_dirs("C:\\Program Files (x86)\\Mono\\lib",
"C:\\Program Files (x86)\\Mono\\etc");
MonoDomain *domain;
@zwcloud
zwcloud / gist:7e78ee9e91c12d4906c9
Created August 23, 2015 10:27
Link error output when build pangocairo with cairo on VS2013.
3>pangocairo-win32font.obj : error LNK2019: unresolved external symbol __imp__cairo_scaled_font_extents referenced in function _pango_cairo_win32_font_create_base_metrics_for_context
3>pangocairo-font.obj : error LNK2001: unresolved external symbol __imp__cairo_scaled_font_extents
3>pangocairo-win32font.obj : error LNK2019: unresolved external symbol __imp__cairo_matrix_init_identity referenced in function __pango_cairo_win32_font_new
3>pangocairo-font.obj : error LNK2001: unresolved external symbol __imp__cairo_matrix_init_identity
3>pangocairo-win32font.obj : error LNK2019: unresolved external symbol __imp__cairo_matrix_scale referenced in function __pango_cairo_win32_font_new
3>pangocairo-win32font.obj : error LNK2019: unresolved external symbol __imp__cairo_win32_font_face_create_for_logfontw referenced in function _pango_cairo_win32_font_create_font_face
3>pangocairo-win32font.obj : error LNK2019: unresolved external symbol __imp__cairo_win32_scaled_font_select_font referenced in function _pango_cairo_wi
@zwcloud
zwcloud / OpenGLWithSFMLDemo.cs
Created October 19, 2015 16:09
Example of using Tao.OpenGL with SFML.NET
using System;
using System.Runtime.InteropServices;
using SFML;
using SFML.Graphics;
using SFML.Window;
using Tao.OpenGl;
namespace opengl
{
static class Program
@zwcloud
zwcloud / SFMLDragableWindow.cpp
Created October 25, 2015 15:55
SFML dragable window demo
//By Hapax from http://en.sfml-dev.org/forums/index.php?topic=14391.msg101187#msg101187
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(800, 600), "", sf::Style::None);
sf::Vector2i grabbedOffset;
bool grabbedWindow = false;
while (window.isOpen())
{
sf::Event event;
@zwcloud
zwcloud / SFMLDragableWindow.cs
Last active December 6, 2015 04:30
a SFML dragable window demo
using System;
using SFML.System;
using SFML.Window;
namespace DragableWindow
{
class DragableWindow : Window
{
private Vector2i grabbedOffset;
private bool grabbedWindow;
@zwcloud
zwcloud / MarkdownDemo.md
Last active October 29, 2015 12:27
针对中文,演示Markdown的各种语法

针对中文,演示Markdown的各种语法

大标题

大标题一般显示工程名,类似html的<h1>
你只要在标题下面跟上=====即可

中标题

@zwcloud
zwcloud / meshtext.ms
Created November 11, 2015 04:44
MaxScript that convert a mesh into text.
tmesh = $Mesh0
num_verts = $Mesh0.numverts
num_faces = $Mesh0.numfaces
format "%,%\n" num_verts num_faces
units.MetricType = #meters
for v = 1 to num_verts do
(
vert = getVert tmesh v
if(abs vert.x < 0.001f) then vert.x = 0f
if(abs vert.y < 0.001f) then vert.y = 0f
@zwcloud
zwcloud / Dog.cs
Created November 21, 2016 08:38
An example on embedding Mono runtime in C/C++.
using System;
public class Dog
{
static public void Type()
{
Console.WriteLine("a Dog!");
}
public void Bark()
{
@zwcloud
zwcloud / ImageComparer.cs
Last active October 13, 2018 04:20 — forked from tocsoft/ImageComparer.cs
Compare 2 images using ImageSharp
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Primitives;
using SixLabors.ImageSharp.Processing;
using System;
using Xunit;
namespace ImageSharp.Extension
{
/// <summary>
@zwcloud
zwcloud / Program.ts
Created March 1, 2019 08:56
Trying rxjs with javascriptcore.
/// <reference types="rx" />
class Program
{
static main(): void
{
console.log("1");
Rx.Observable.range(1, 10).subscribe(x => console.log(x));
console.log("2");
}