hmi.environment
Class GLTextureWow

java.lang.Object
  extended by hmi.environment.GLTextureWow

public class GLTextureWow
extends Object

2D texture. For non power of two images there are three options: hardware, stretch, and pad. For pad, non power of two images are mapped to the bottom left corner of a power of two texture. Use getMaxS() and getMaxT() to get the float coordinates of the topright corner (bottom left corner is 0,0). For stretch, non power of two images are stretched to fit the power of two texture. user getSStretch() and getTStretch() to get the stretch factors. Supported (set through mipmaps and smooth flags): GL_TEXTURE_MIN_FILTER, GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_LOD, GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, GL_TEXTURE_MAX_LEVEL, Set through wrap: GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T N/A: GL_TEXTURE_WRAP_R not supported: GL_TEXTURE_PRIORITY

Author:
Boris van Schooten used specifically to enable the WowVX screen....

Field Summary
 int height
           
 boolean mipmap
           
 int name
          GL name of this texture
static int NPOT_HARDWARE
           
static int NPOT_PAD
           
static int NPOT_STRETCH
           
private static int npotmode
           
 int origheight
           
 int origwidth
           
 boolean smooth
           
 int totalheight
           
 int totalwidth
           
 int width
           
 
Constructor Summary
GLTextureWow(GLRenderContext glc, int[] data, int width, int height, boolean mipmap, boolean smooth)
          Define empty texture; wrap is initially enabled for s and t.
GLTextureWow(GLRenderContext glc, int width, int height, boolean mipmap, boolean smooth)
          Define empty texture; wrap is initially enabled for s and t.
 
Method Summary
 void bind(GLRenderContext glc)
          BindTexture
 void copyDepthBuffer(GLRenderContext glc, int x, int y)
          copies part of depth buffer into texture (glCopyTexImage)
 void copyRenderBuffer(GLRenderContext glc, int x, int y)
          copies part of render buffer into texture (glCopyTexImage)
 void disable(GLRenderContext glc)
          Disable GL_TEXTURE
static void disableTex(GLRenderContext glc)
          Disable GL_TEXTURE
 void enable(GLRenderContext glc)
          Enable GL_TEXTURE
static void enableTex(GLRenderContext glc)
          Enable GL_TEXTURE
 void free(GLRenderContext glc)
           
 int getHeight()
           
 float getMaxS()
           
 float getMaxT()
           
 float getSStretch()
           
 float getTStretch()
           
 int getWidth()
           
(package private)  void initialise(GLRenderContext glc, int[] data, int width, int height, boolean mipmap, boolean smooth)
          Define empty texture; wrap is initially enabled for s and t.
static void setNPOTMode(int mode)
           
static int smallestPowerOfTwo(int i)
           
 void writeToGL(GLRenderContext glc)
          Write glTextureParameters to GL state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public int name
GL name of this texture


mipmap

public boolean mipmap

smooth

public boolean smooth

origwidth

public int origwidth

origheight

public int origheight

width

public int width

height

public int height

totalwidth

public int totalwidth

totalheight

public int totalheight

NPOT_HARDWARE

public static final int NPOT_HARDWARE
See Also:
Constant Field Values

NPOT_STRETCH

public static final int NPOT_STRETCH
See Also:
Constant Field Values

NPOT_PAD

public static final int NPOT_PAD
See Also:
Constant Field Values

npotmode

private static int npotmode
Constructor Detail

GLTextureWow

public GLTextureWow(GLRenderContext glc,
                    int width,
                    int height,
                    boolean mipmap,
                    boolean smooth)
Define empty texture; wrap is initially enabled for s and t.


GLTextureWow

public GLTextureWow(GLRenderContext glc,
                    int[] data,
                    int width,
                    int height,
                    boolean mipmap,
                    boolean smooth)
Define empty texture; wrap is initially enabled for s and t.

Parameters:
data - width*height*4 bytes (RGBA values)
Method Detail

smallestPowerOfTwo

public static int smallestPowerOfTwo(int i)

setNPOTMode

public static void setNPOTMode(int mode)

initialise

void initialise(GLRenderContext glc,
                int[] data,
                int width,
                int height,
                boolean mipmap,
                boolean smooth)
Define empty texture; wrap is initially enabled for s and t.


free

public void free(GLRenderContext glc)

copyDepthBuffer

public void copyDepthBuffer(GLRenderContext glc,
                            int x,
                            int y)
copies part of depth buffer into texture (glCopyTexImage)


copyRenderBuffer

public void copyRenderBuffer(GLRenderContext glc,
                             int x,
                             int y)
copies part of render buffer into texture (glCopyTexImage)


enable

public void enable(GLRenderContext glc)
Enable GL_TEXTURE


enableTex

public static void enableTex(GLRenderContext glc)
Enable GL_TEXTURE


disable

public void disable(GLRenderContext glc)
Disable GL_TEXTURE


disableTex

public static void disableTex(GLRenderContext glc)
Disable GL_TEXTURE


bind

public void bind(GLRenderContext glc)
BindTexture


getMaxS

public float getMaxS()

getMaxT

public float getMaxT()

getSStretch

public float getSStretch()

getTStretch

public float getTStretch()

getWidth

public int getWidth()

getHeight

public int getHeight()

writeToGL

public void writeToGL(GLRenderContext glc)
Write glTextureParameters to GL state.