Skip to content

Instantly share code, notes, and snippets.

View paulhoux's full-sized avatar
🏠
Working from home

Paul Houx paulhoux

🏠
Working from home
View GitHub Profile
@paulhoux
paulhoux / CirclesApp.cpp
Created February 28, 2020 15:09
Instanced Circles using `geom::Ring`
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
using namespace ci;
using namespace ci::app;
using namespace std;
class CirclesApp : public App {
public:
@paulhoux
paulhoux / ProgressBarApp.cpp
Last active February 26, 2019 22:42
Example of a background loading thread with a progress bar. Meant to be used with Cinder: https://libcinder.org
#include "cinder/Utilities.h"
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
using namespace ci;
using namespace app;
using namespace std;
class ProgressBarApp : public App {
@paulhoux
paulhoux / FastTexture.cpp
Created February 14, 2019 13:37
Fast texture loading using S3TC+LZ4 compressed textures.
/*
Copyright (c) 2019, Paul Houx - All rights reserved.
This code is intended for use with the Cinder C++ library: http://libcinder.org
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 copyright notice, this list of conditions and
@paulhoux
paulhoux / CanvasUi.h
Created February 11, 2017 13:46
CanvasUi: a simple 2D modifier tool to drag and zoom your work area. Made for Cinder.
/*
Copyright (c) 2016, Paul Houx - All rights reserved.
This code is intended for use with the Cinder C++ library: http://libcinder.org
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 copyright notice, this list of conditions and
@paulhoux
paulhoux / YourApp.cpp
Last active May 14, 2016 20:25
Semi-Circle Example (with shader).
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
using namespace ci;
using namespace ci::app;
using namespace std;
class YourApp : public App {
public:
@paulhoux
paulhoux / QuadCircle.cpp
Last active January 23, 2016 06:52
Circle of Quads
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
#include "cinder/Camera.h"
#include "cinder/CameraUi.h"
#include "cinder/ip/Checkerboard.h"
using namespace ci;
using namespace ci::app;
@paulhoux
paulhoux / colorwheel.cpp
Created October 30, 2015 00:02
Fix for NanoGui's ColorWheel::adjustPosition() method.
ColorWheel::Region ColorWheel::adjustPosition(const ivec2 &p, Region consideredRegions)
{
float x = p.x - mPos.x, y = p.y - mPos.y, w = mSize.x, h = mSize.y;
float cx = w*0.5f;
float cy = h*0.5f;
float r1 = (w < h ? w : h) * 0.5f - 5.0f;
float r0 = r1 * .75f;
x -= cx;
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
#include "cinder/Rand.h"
using namespace ci;
using namespace ci::app;
using namespace std;
class VivekSampleApp : public App {
@paulhoux
paulhoux / CubeMapApp.cpp
Last active August 29, 2015 14:24
Shows how to render a dynamic scene as 6 faces of a cube map (horizontal cross)
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
#include "cinder/Camera.h"
#include "cinder/Rand.h"
using namespace ci;
using namespace ci::app;
using namespace std;
@paulhoux
paulhoux / GradientApp.cpp
Created June 5, 2015 22:59
Example of how to create a texture from code. Here, we create a gradient texture.
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
using namespace ci;
using namespace ci::app;
using namespace std;
typedef std::pair<float, ColorA> ColorStop;