#include #include #include int main (void) { int e; int buffer; if (glfwInit() != GL_TRUE) errx(1, "glfwInit"); glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3); glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 1); if (glfwOpenWindow(640, 480, 8, 8, 8, 0, 24, 8, GLFW_WINDOW) != GL_TRUE) errx(1, "glfwOpenWindow"); printf("renderer : %s\n", glGetString(GL_RENDERER)); printf("version : %s\n", glGetString(GL_VERSION)); printf("vendor : %s\n", glGetString(GL_VENDOR)); glGenBuffers(1, &buffer); if (glGetError() != GL_NO_ERROR) errx(1, "glGenBuffers"); glBindBuffer(GL_ARRAY_BUFFER, buffer); if (glGetError() != GL_NO_ERROR) errx(1, "glBindBuffer"); glBufferData(GL_ARRAY_BUFFER, 4 * 32, NULL, GL_STATIC_DRAW); if (glGetError() != GL_NO_ERROR) errx(1, "glBufferData"); glEnableVertexAttribArray(1); if (glGetError() != GL_NO_ERROR) errx(1, "glEnableVertexAttribArray"); glVertexAttribPointer(1, 4, GL_FLOAT, 0, 0, 0L); e = glGetError(); printf("glVertexAttribPointer: %x\n", e); glfwTerminate(); return 0; }