Skip to content

Instantly share code, notes, and snippets.

@nlguillemot
nlguillemot / gist:add8ef4679581c76e000
Last active August 29, 2015 14:14
updated glsl.xml that handles identifiers. previously, the 3 in the identifier or macro name "vertic3s" would become highlighted. Also fixed "0" not being highlighted in layouts along with hex/octal constants being used in layouts.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<!-- the version of this file shows the largest supported OpenGL version, second digit is the minor patch level (Y.XP = supports GLSL X.Y0 with patchlevel P -->
<language name="GLSL" section="Sources" extensions="*.glsl;*.vsh;*.vert;*.tcsh;*.tcs;*.tesh;*.tes;*.gsh;*.geo;*.geom;*.fsh;*.frag;*.csh;*.cs" mimetype="text/x-glslsrc" version="4.40" kateversion="2.4" author="Robert Menzel (mail@renderingpipeline.com)" license="LGPL">
<highlighting>
<!-- ####################################################################################################### keywords -->
<list name="keywordsCompatibility">
<!-- compatibility mode, older GLSL versions -->
<item>attribute</item>
@nlguillemot
nlguillemot / gist:b1981969b07295376674
Created December 19, 2014 17:58
utility function to convert GLenum error codes to strings like gluErrorString
const char* GLErrorToString(GLenum err)
{
switch (err)
{
case GL_NO_ERROR: return "GL_NO_ERROR";
case GL_INVALID_ENUM: return "GL_INVALID_ENUM";
case GL_INVALID_VALUE: return "GL_INVALID_VALUE";
case GL_INVALID_OPERATION: return "GL_INVALID_OPERATION";
case GL_STACK_OVERFLOW: return "GL_STACK_OVERFLOW";
case GL_STACK_UNDERFLOW: return "GL_STACK_UNDERFLOW";
2> parser.cpp
2>C:\cygwin\home\Nicolas\Programming\vklang\src\vk\parser.cpp(273): error C2280: 'std::unique_ptr<vk::TypeExpression,std::default_delete<_Ty>>::unique_ptr(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference a deleted function
2> with
2> [
2> _Ty=vk::TypeExpression
2> ]
2> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\memory(1486) : see declaration of 'std::unique_ptr<vk::TypeExpression,std::default_delete<_Ty>>::unique_ptr'
2> with
2> [
2> _Ty=vk::TypeExpression
@nlguillemot
nlguillemot / main.d
Created June 11, 2013 07:14
gtkD with opengl3 using derelict3
import gdk.Event;
import gtk.DrawingArea;
import gtk.Main;
import gtk.MainWindow;
import gtk.Widget;
import gtk.Button;
import gtk.VBox;
import glgdk.GLConfig;
import glgdk.GLContext;
@nlguillemot
nlguillemot / Makefile
Created April 18, 2013 08:14
GLFWcursorposfun test
all:
dmd main.d -L-lDerelictGL3 -L-lDerelictGLFW3 -L-lDerelictUtil -L-ldl
import derelict.opengl3.gl3;
import derelict.glfw3.glfw3;
void main(){
DerelictGL3.load();
DerelictGLFW3.load();
glfwInit();
GLFWwindow* window = glfwCreateWindow(640,480,"Hello, World!",null,null);
@nlguillemot
nlguillemot / gist:5410561
Created April 18, 2013 06:16
dmd main.d -L-lDerelictGL3
import derelict.opengl3.gl3;
void main(){
DerelictGL3.load();
}
/usr/local/lib/d/libDerelictGL3.a(gl3_8d_649.o):(.data+0x38): undefined reference to `_D8derelict4util6loader15SharedLibLoader7__ClassZ'
/usr/local/lib/d/libDerelictGL3.a(gl3_8d_649.o):(.rodata+0x2508): undefined reference to `_D8derelict4util6loader15SharedLibLoader4loadMFZv'
/usr/local/lib/d/libDerelictGL3.a(gl3_8d_649.o):(.rodata+0x250c): undefined reference to `_D8derelict4util6loader15SharedLibLoader4loadMFAyaZv'
/usr/local/lib/d/libDerelictGL3.a(gl3_8d_649.o):(.rodata+0x2510): undefined reference to `_D8derelict4util6loader15SharedLibLoader4loadMFAAyaZv'
@nlguillemot
nlguillemot / woo
Created November 23, 2012 07:53
banana
# core {{{
[core]
editor = vim
# }}}
# user {{{
[user]
name = Nicolas Guillemot
email = nlguillemot@gmail.com
# }}}
@nlguillemot
nlguillemot / main.c
Created August 14, 2012 07:27
attempt to sort image by hue
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <math.h>
SDL_Surface *screen;
float hue_from_rgb(int r, int g, int b)
{
// return atan2(sqrt(3.0) * (g - b), 2.0f * r - g - b);
return atan2(2.0f * r - g - b, sqrt(3.0) * (g - b));
@nlguillemot
nlguillemot / practice.md
Created August 7, 2012 06:55
practice test for SENG 271

OO Concepts

Define the following terms in OO context.

  • class
  • object
  • interface
  • abstract
  • concrete
  • inheritence
  • composition