Skip to content

Instantly share code, notes, and snippets.

@tmpvar
Created August 13, 2011 23:00
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmpvar/1144349 to your computer and use it in GitHub Desktop.
Save tmpvar/1144349 to your computer and use it in GitHub Desktop.
Opengl factoids

OpenGL

This is a notepad for my journey to learn opengl's programmable pipeline

Tutorials

Examples & Tutorials

Sections

Basics

Types

typedef unsigned int GLenum;
typedef unsigned char GLboolean;
typedef unsigned int GLbitfield;
typedef signed char GLbyte;
typedef short GLshort;
typedef int GLint;
typedef int GLsizei;
typedef unsigned char GLubyte;
typedef unsigned short GLushort;
typedef unsigned int GLuint;
typedef float GLfloat;
typedef float GLclampf;
typedef double GLdouble;
typedef double GLclampd;
typedef void GLvoid;

typedef long GLintptr;
typedef long GLsizeiptr;

Texturing

Q/A

Why do some of the examples I see have 4D's?

These are homogeneous coordinates : http://en.wikipedia.org/wiki/Homogeneous_coordinates

Why is only one pixel of my texture being rendered?

You need to enable the vertex attrib for the shader param that controls the texture.

GLint textureAttribute = glGetAttribLocation(program, name);
// ...
glEnableVertexAttribArray(textureAttribute);
@Ratstail91
Copy link

The link under the tutorials section above is amazing. I've read a couple pages, and I now already understand: vector maths, OpenGL binding/object manipulation, and OpenGL's internal structure. This will help a lot with my projects, so thanks to the writer, and to the owner of this gist :)

@tmpvar
Copy link
Author

tmpvar commented May 17, 2012

awesome! happy I could help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment