PDA

View Full Version : Simple glVertex3hNV example



Nicholas Y
12-06-2009, 03:30 AM
Hi,

Does anyone have a simple example show glVertex3hNV()?

Or a URL to an open source project which illustrate it's usage.

[preference would be the simple example]

Regards

Dark Photon
12-06-2009, 06:28 PM
Does anyone have a simple example show glVertex3hNV()?
Not much to show. You just have to compute the bits of 3 half-floats, store them each in a GLhalfNV type (an unsigned short), and pass them in.

Is your question how to create a half-float number? If so, search down for "half has a value of N" in this extension spec: NV_half_float (http://www.opengl.org/registry/specs/NV/half_float.txt).

Also, why are going to the trouble of using half-floats if you're using immediate mode. Use of the latter implies you could care less about performance (or are letting the driver build display lists).