Skip to content

Instantly share code, notes, and snippets.

@iondune
iondune / OpenGLDebug.cpp
Last active February 12, 2017 13:05
OpenGL Debugging Tools
#include "OpenGLDebug.h"
char const * GetOpenGLErrorString(GLenum const Error)
{
switch (Error)
{
case GL_NO_ERROR:
return "GL_NO_ERROR";
case GL_INVALID_ENUM:
@iondune
iondune / CClipmapsSceneObject.IndexData.cpp
Created February 5, 2017 07:04
How to build index data for clipmaps with degenerate triangles.
// Standard LL
IndexData.push_back(x + 0 + (GeometrySize + 1) * (y + 1));
IndexData.push_back(x + 1 + (GeometrySize + 1) * (y + 1));
IndexData.push_back(x + 0 + (GeometrySize + 1) * (y + 0));
// Standard UR
IndexData.push_back(x + 1 + (GeometrySize + 1) * (y + 1));
IndexData.push_back(x + 1 + (GeometrySize + 1) * (y + 0));
IndexData.push_back(x + 0 + (GeometrySize + 1) * (y + 0));
@iondune
iondune / CSC371.md
Last active December 24, 2016 00:51
Course outline for CSC 371: Game Design

CSC 371: Game Design

Week 1

Lecture

Game Design -- including meaningful play, context, game state, and environment.

Lab

@iondune
iondune / OpenSimplexNoise.hh
Created May 31, 2016 20:12 — forked from tombsar/OpenSimplexNoise.hh
C++ port of KdotJPG's OpenSimplexNoise in Java. A self-contained set of functions for generating visually axis-decorrelated, coherent noise from a simplectic honeycomb.
/*
* OpenSimplex (Simplectic) Noise in C++
* by Arthur Tombs
*
* Modified 2015-01-08
*
* This is a derivative work based on OpenSimplex by Kurt Spencer:
* https://gist.github.com/KdotJPG/b1270127455a94ac5d19
*
* Anyone is free to make use of this software in whatever way they want.
ActiveCameraPosition = ActiveCamera->GetPosition() / 0.1f;
vec3f const Translation = vec3f(
(float) (Layer->ActiveRegion.Position.X * Layer->ScaleFactor * 0.1f - GlobalSystemOffset.X),
0.f,
(float) (Layer->ActiveRegion.Position.Y * Layer->ScaleFactor * 0.1f - GlobalSystemOffset.Y));
vec3f const Scale = vec3f(
(float) Layer->ScaleFactor * 0.1f,
0.1f,
(float) Layer->ScaleFactor * 0.1f);
vec3f WorldCoordinates = vec3f(...);
bool InFront;
vec2i Coords = FreeCamera->GetScreenCoordinates(WorldCoordinates, &InFront);
if (InFront)
{
GUIManager->Text(Coords, "Hello, World!");
}
@iondune
iondune / Event.cpp
Created April 10, 2016 22:08
Respond to an ionEngine event
void CApplication::OnEvent(IEvent & Event)
{
if (InstanceOf<SKeyboardEvent>(Event))
{
SKeyboardEvent KeyboardEvent = As<SKeyboardEvent>(Event);
if (! KeyboardEvent.Pressed)
{
switch (KeyboardEvent.Key)
{

Version 0.4

New since 0.3.2

  • GraphicsAPI is now singleton and is initialized with a GraphicsImplementation
    • Lots of interfaces no longer required a GraphicsAPI pointer
  • Engine initialization path is now more clear
  • Minor cleanup in ionMath
    • Changed a few method names
    • Add features to vec3 and box3
CUniform<color3f> uColor = Colors::Red;
ClothObjectFront->SetUniform("uColor", uColor);
// later
uColor = Colors::Blue;
// (this automatically changes the uniform used by the cloth object)