Skip to content

Commit

Permalink
Yet more header file comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
sesse committed Oct 3, 2012
1 parent e8650c7 commit e8cff13
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 14 additions & 1 deletion util.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef _UTIL_H
#define _UTIL_H 1

// Various utilities.

#include <stdio.h>
#include <stdlib.h>

Expand All @@ -10,16 +12,27 @@

#define BUFFER_OFFSET(i) ((char *)NULL + (i))

// assumes h in [0, 2pi> or [-pi, pi>
// Converts a HSV color to RGB. Assumes h in [0, 2pi> or [-pi, pi>
void hsv2rgb(float h, float s, float v, float *r, float *g, float *b);

// Column major (same as OpenGL).
typedef double Matrix3x3[9];

// Read a file from disk and return its contents.
// Dies if the file does not exist.
std::string read_file(const std::string &filename);

// Compile the given GLSL shader (typically a vertex or fragment shader)
// and return the object number.
GLuint compile_shader(const std::string &shader_src, GLenum type);

// Compute a * b.
void multiply_3x3_matrices(const Matrix3x3 a, const Matrix3x3 b, Matrix3x3 result);

// Compute m^-1. Result is undefined if the matrix is singular or near-singular.
void invert_3x3_matrix(const Matrix3x3 m, Matrix3x3 result);

// Print a 3x3 matrix to standard output. Useful for debugging.
void print_3x3_matrix(const Matrix3x3 m);

#ifdef NDEBUG
Expand Down
2 changes: 2 additions & 0 deletions widgets.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef _WIDGETS_H
#define _WIDGETS_H 1

// Some simple UI widgets for test use.

void draw_hsv_wheel(float y, float rad, float theta, float value);
void draw_saturation_bar(float y, float saturation);
void make_hsv_wheel_texture();
Expand Down

0 comments on commit e8cff13

Please sign in to comment.