Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

Ratstail91 commented May 17, 2012

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

This comment has been minimized.

Copy link
Owner 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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.