This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <chrono> | |
#include <iostream> | |
#ifdef __APPLE__ | |
#include <OpenGL/gl.h> | |
#include <OpenGL/glu.h> | |
#include <GLUT/glut.h> | |
#else | |
#ifdef _WIN32 | |
#include <windows.h> | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Naive port of https://github.com/CreativeInquiry/ofxBussIK | |
#include <iostream> | |
#include "sre/Texture.hpp" | |
#include "sre/Renderer.hpp" | |
#include "sre/Material.hpp" | |
#include "LinearR3.h" | |
#include "Tree.h" | |
#include "Jacobian.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while (running){ | |
frame(deltaTime); | |
auto tick = Clock::now(); | |
deltaTime = std::chrono::duration_cast<FpSeconds>(tick - lastTick).count(); | |
// todo fix busy wait | |
// https://forum.lazarus.freepascal.org/index.php?topic=35689.0 | |
while (deltaTime < timePerFrame){ | |
SDL_Delay((Uint32) ((timePerFrame - deltaTime) / 1000)); | |
tick = Clock::now(); | |
deltaTime = std::chrono::duration_cast<FpSeconds>(tick - lastTick).count(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Compile for emscripten using | |
// emcc -Iinclude SingleFileOpenGLTex.cpp \ | |
-O2 -std=c++14 -s TOTAL_MEMORY=33554432 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='["png"]' --preload-file examples/data -s USE_SDL=2 -o html/SingleFileOpenGLTex.html | |
// where the following images must be located in a subfolder | |
// - examples/data/test.png | |
// - examples/data/cartman.png | |
// - examples/data/cube-negx.png | |
// - examples/data/cube-negz.png | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "SDL.h" | |
// OSX only - change on other platforms | |
#include <OpenGL/gl3.h> | |
#include <stdlib.h> //rand() | |
#include <iostream> | |
#include <string> | |
static bool quitting = false; | |
static SDL_Window *window = NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by Morten Nobel-Jørgensen on 20/11/2016. | |
// | |
#include "Handle.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "SDL.h" | |
// OSX only - change on other platforms | |
#include <OpenGL/gl3.h> | |
#include <stdlib.h> //rand() | |
#include <iostream> | |
#include <string> | |
static bool quitting = false; | |
static SDL_Window *window = NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Threading; | |
using System.Text; | |
public class HelloSocketWorld : MonoBehaviour { | |
public string history; | |
public string txt; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Loosely based on http://superuser.com/a/533706 | |
ffmpeg -framerate 10 -i shot\ %04d.png -s:v 1280x720 -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p smart-avenue-1.mp4 |
NewerOlder