EasyManuals Logo
Home>HP>Desktop>b2600

HP b2600 Reference Guide

HP b2600
486 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #238 background imageLoading...
Page #238 background image
I
glXIntro
Chapter 9
238
glXIntro
glXIntro: Introduction to OpenGL in the X Window system.
Overview
OpenGL (called GL in other pages) is a high-performance 3D-oriented renderer. It is
available in the X window system through the GLX extension. To determine whether the
GLX extension is supported by an X server, and if so, what version is supported, call
glXQueryExtension and glXQueryVersion.
GLX extended servers make a subset of their visuals available for OpenGL rendering.
Drawables created with these visuals can also be rendered using the core X renderer and
with the renderer of any other X extension that is compatible with all core X visuals.
GLX extends drawables with several buffers other than the standard color buffer. These
buffers include back and auxiliary color buffers, a depth buffer, a stencil buffer, and a
color accumulation buffer. Some or all are included in each X visual that supports
OpenGL.
To render using OpenGL into an X drawable, you must first choose a visual that defines
the required OpenGL buffers. glXChooseVisual can be used to simplify selecting a
compatible visual. If more control of the selection process is required, use
XGetVisualInfo and glXGetConfig to select among all the available visuals.
Use the selected visual to create both a GLX context and an X drawable. GLX contexts
are created with glXCreateContext, and drawables are created with either
XCreateWindow or glXCreateGLXPixmap. Finally, bind the context and the drawable
together using glXMakeCurrent. This context/drawable pair becomes the current
context and current drawable, and it is used by all OpenGL commands until
glXMakeCurrent is called with different arguments.
Both core X and OpenGL commands can be used to operate on the current drawable. The
X and OpenGL command streams are not synchronized, however, except at explicitly
created boundaries generated by calling glXWaitGL, glXWaitX, XSync, and glFlush.
Examples
Below is the minimum code required to create an RGBA-format, X window that’s
compatible with OpenGL and to clear it to yellow. The code is correct, but it does not
include any error checking. Return values dpy, vi, cx, cmap, and win should all be tested.
#include <GL/glx.h>
#include <GL/gl.h>
#include <unistd.h>
static int attributeListSgl[] = {
GLX_RGBA,
GLX_RED_SIZE, 1, /*get the deepest buffer with 1 red bit*/
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
None};
static int attributeListDbl[] = {

Table of Contents

Other manuals for HP b2600

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the HP b2600 and is the answer not in the manual?

HP b2600 Specifications

General IconGeneral
BrandHP
Modelb2600
CategoryDesktop
LanguageEnglish

Related product manuals