background preloader

OpenGL

Facebook Twitter

Tutorial 2 : The first triangle | opengl-tutorial.org. This will be another long tutorial. OpenGL 3 makes it easy to write complicated stuff, but at the expense that drawing a simple triangle is actually quite difficult. Don’t forget to cut’n paste the code on a regular basis. If the program crashes at startup, you’re probably running from the wrong directory. Read CAREFULLY the first tutorial on how to configure Visual Studio ! I won’t dig into details now, but you need to create a Vertex Array Object and set it as the current one : Do this once your window is created (= after the OpenGL Context creation) and before any other OpenGL call.

If you really want to know more about VAOs, there are a few other tutorials out there, but this is not very important. A triangle is defined by three points. X in on your rightY is upZ is towards your back (yes, behind, not in front of you) But here is a better way to visualize this : use the Right Hand Rule X is your thumbY is your indexZ is your middle finger. The first vertex is (-1,-1,0). Shader Compilation. Opengl-tutorial.org | Tutorials for OpenGL 3.3 and later. Getting Started. So you want to take advantage of the power of the OpenGL API? If you are visiting this page because a game or software uses the OpenGL API, you need to install the appropriate graphic driver which enables usage of the functionality provided. To program using the OpenGL API, you need the driver and the development package (depends on platform and programming language). More platform-specific details are described in the sections below.

This Wiki maintains a FAQ page for OpenGL. There is an older FAQ available, but information in it is more likely to be out of date. Downloading OpenGL In all three major desktop platforms (Linux, MacOS X, and Windows), OpenGL more or less comes with the system. Windows Appropriate Windows driver websites: Some sites also distribute beta versions of graphics drivers, which may give you access to bug fixes or new functionality before an official driver release from the manufacturer: Guru3D Linux Mac OS X Writing an OpenGL Application Initialization Getting Functions.

Learning Modern 3D Graphics Programming. An intro to modern OpenGL. Chapter 1: The Graphics Pipeline. An intro to modern OpenGL. Chapter 1: The Graphics Pipeline updated April 5, 2010 17:12:05 PDT Table of Contents | Chapter 2 » OpenGL has been around a long time, and from reading all the accumulated layers of documentation out there on the Internet, it's not always clear what parts are historic and what parts are still useful and supported on modern graphics hardware.

Update: Join the Reddit discussion. What is OpenGL? Another recent development has been the adoption of general purpose GPU (GPGPU) libraries, including nVidia's CUDA and Khronos' OpenCL. For these tutorials, I'm going to assume you're already a programmer and that you know C, but that you haven't necessarily seen OpenGL or done graphics programming before. Where do I get OpenGL, GLUT, and GLEW? OpenGL comes standard in some form or another on MacOS X, Windows, and most Linux distributions. To install GLUT and GLEW, look for the binary packages on their respective sites. The graphics pipeline The vertex and element arrays.