Skip to content

Instantly share code, notes, and snippets.

@keithjohnston
keithjohnston / pan_zoom_and_drag.dart
Last active September 20, 2023 01:13
Flame example
import 'dart:io' show Platform;
import 'dart:math';
import 'package:flame/components.dart';
import 'package:flame/events.dart';
import 'package:flame/game.dart';
import 'package:flame/input.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
//
// Copyright (c) 2014-2016 THUNDERBEAST GAMES LLC
//
// 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:
//
//
// Copyright (c) 2014-2016 THUNDERBEAST GAMES LLC
//
// 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:
//
//
// Copyright (c) 2014-2016 THUNDERBEAST GAMES LLC
//
// 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:
//
//
// Copyright (c) 2014-2016 THUNDERBEAST GAMES LLC
//
// 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:
//
ResourceCache* cache = GetSubsystem<ResourceCache>();
Scene* scene = new Scene(GetContext());
Octree* octree = scene->CreateComponent<Octree>();
Graphics* graphics = GetSubsystem<Graphics>();
Node* cameraNode = scene->CreateChild("Camera");
cameraNode->SetPosition(Vector3(0.0f, 0.0f, -10.0f));
#include "jsapi.h"
// Compile for OSX:
// /usr/bin/clang++ -I include -m32 -std=c++0x -g helloworld.cpp -lobjc libjs_static.a -l z -l m
#include "jsapi.h"
/* The class of the global object. */
static JSClass global_class = {
"global",
@keithjohnston
keithjohnston / minidump_stackwalk.cc
Created January 7, 2014 22:56
A modified minidump_stackwalk.cc to output stack traces in a format consumable by HockeyApp.
// Copyright (c) 2010 Google Inc.
// All rights reserved.
//
// 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